package main

import (
	in "bbtradeByGo/init"
	"bbtradeByGo/pkg/logging"
	cur "bbtradeByGo/service/currency"
	"bbtradeByGo/pkg/email"
	"time"
)

func run() {
	time := time.NewTicker(time.Second * 5)
	for _ = range time.C{
          if err := cur.Currency(); err != nil{
			  email.SendMail("service.currency", err.Error())
			  logging.Error("service.currency", err)
		  }
          cur.Price()
	}
}

func main() {
	//项目初始化
	in.Init()
	logging.Info("entrance/cache process is running")
	run()
}